package cn.buddha.jec.model.head;

import cn.buddha.jec.exception.model.TongExceptionResult;
import cn.buddha.jec.model.TongBaseData;
import cn.buddha.jec.util.TongDateUtils;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName TongOutHead
 * @Author 友野浩二
 * @Description 业务响应头信息(包含消息码 、 交易唯一序号等)
 * @Version 1.0
 */
//@Data
@Setter
@Getter
@EqualsAndHashCode(callSuper = false)
@AllArgsConstructor
@NoArgsConstructor
public class TongOutHead extends TongBaseData {
    private static final long serialVersionUID = 3308923368673566410L;

    /**
     * 返回结果集,存储异常码和异常消息
     */
    private List<TongExceptionResult> exceptionResultList;

    /**
     * 服务流程编号,全局唯一序列号
     */
    private String flowableId;

    /**
     * 交易响应时间戳(格式: yyyy-MM-dd HH:mm:ss.SSS)
     */
    private String tranDateTime;

    /**
     * 响应文件路径
     */
    private String resFilePath;

    public TongOutHead(TongExceptionResult exceptionResult) {
        this.exceptionResultList = new ArrayList<>();
        this.exceptionResultList.add(exceptionResult);

        this.tranDateTime = TongDateUtils.createNowTimestamp();
    }
}
